@{ViewBag.Title = " HistorialAntecedente "; Layout = "../Shared/_LayoutJtable.cshtml";}

<div class="filtering"><form>
<label>Introduzca texto para filtrar: <input type="text" name="filter" id="filter" /></label>
<button type="submit" id="LoadRecordsButton" class="button medium orange" >Buscar Coincidencias</button>
</form></div>
<div id="MyTableContainer"></div>
<script type="text/javascript">
     $(document).ready(function () {
     $('#MyTableContainer').jtable({
         title: 'HistorialAntecedente',
         paging: true,
         pageSize: 40,
         sorting: true,
         defaultSorting: 'Id ASC',
         actions: {
             listAction: '@Url.Action("JSONPagedListByFilter")',
             deleteAction: '@Url.Action("JSONDelete")',
             updateAction: '@Url.Action("JSONUpdate")',
             createAction: '@Url.Action("JSONCreate")'
         },
         fields:
         {
          Id: {
                 key: true,
                 create: false,
                 edit: false,
                 list: false
             }
             ,
             Guid: {
                 type: 'hidden'
             }
             ,
             PuntosMeritoDemerito: {
                 title:'PuntosMeritoDemerito',
                 create: true,
                 edit: true,
                 list: true,
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             Descripcion: {
                 title:'Descripcion',
                 type: 'textarea',
                 create: true,
                 edit: true,
                 list: true,
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             FechaRegistro: {
                 title:'FechaRegistro',
                 create: true,
                 edit: true,
                 list: true,
                 type: 'date',
                 displayFormat: 'dd/mm/yy',
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             FechaPenalizado: {
                 title:'FechaPenalizado',
                 create: true,
                 edit: true,
                 list: true,
                 type: 'date',
                 displayFormat: 'dd/mm/yy',
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             RegistradoPor: {
                 title:'RegistradoPor',
                 create: true,
                 edit: true,
                 list: true,
                 inputClass: 'validate[required]',
                 sorting: false
             }
             ,
             DestinoAsignadoId_FK:{
                 title : 'DestinoAsignado',
                 create : true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../DestinoAsignado/JSONGetElementsForDropDownList")'
             }
             ,
             PersonaId_FK:{
                 title : 'Persona',
                 create : true,
                 edit : true,
                 list : true,
                 options : '@Url.Action("../Persona/JSONGetElementsForDropDownList")'
             }
},
formCreated: function (event, data) {data.form.validationEngine();},
formSubmitting: function (event, data) {return data.form.validationEngine('validate');},
formClosed: function (event, data) { data.form.validationEngine('hide'); data.form.validationEngine('detach'); }
});
$('#LoadRecordsButton').click(function (e) {e.preventDefault();$('#MyTableContainer').jtable('load', {filter: $('#filter').val()});});
$('#LoadRecordsButton').click();
});
</script>

